package com.mooc.yohoshop.ui.checkorder;

import com.mooc.yohoshop.ApiService;
import com.mooc.yohoshop.entity.BaseEntity;
import com.mooc.yohoshop.network.BaseRepository;
import com.mooc.yohoshop.network.HttpFactory;
import com.mooc.yohoshop.network.HttpType;
import java.util.HashMap;
import io.reactivex.Observable;

public class CheckOrderRepo extends BaseRepository {

    //获取订单详情
    public Observable<BaseEntity>requestOrderValues(HashMap<String,Object> map){
        return convertObservable(HttpFactory.factory(HttpType.UPLOADTYPE)
                .getRetrofit().create(ApiService.class).requestDetailOrder(createBody(map)));
    }

    //获取支付签名
    public Observable<BaseEntity>requestPaySign(HashMap<String,Object> map){
        return convertObservable(HttpFactory.factory(HttpType.TOKEN)
                .getRetrofit().create(ApiService.class).requestPaySign(createBody(map)));
    }

    //校验支付结果修改订单状态
    public Observable<BaseEntity>requestCheckOrder(HashMap<String,Object> map){
        return convertObservable(HttpFactory.factory(HttpType.UPLOADTYPE)
                .getRetrofit().create(ApiService.class).requestCheckPay(createBody(map)));
    }

}
